@extends('layouts.home.layout')
@section('content')
    @include('layouts.home._nav')

    <div class="validation main">
        <div class="validation_title">
            <img src="{{asset('home')}}/images/yanzheng3_03.png" />
            <h1>请提交个人资产资料</h1>
        </div>
        <form action="{{url('apply/threestep')}}" name="threeForm" id="threeForm" method="post">
            <input type="hidden" name="recordid" value="{{$recordid}}">
        <div class="yzbox">
            <p>年龄</p>
            <div class="yzinput_box">
                <input  placeholder="" name="age" class="yzbox_input"/>
                <p>岁</p>
            </div>
        </div>
        <div class="yzbox">
            <p>性别</p>
            <div class="radiobox">
                <input type="radio" name="sex" value="1" class="xianjin"/><p>男</p>
                <input type="radio" name="sex" value="0" class="chuxuka"/><p>女</p>
            </div>
        </div>
        <div class="yzbox">
            <p>户籍</p>
            <div class="radiobox">
                <input type="radio" name="register" value="1" class="xianjin"/><p>本地</p>
                <input type="radio" name="register" value="0" class="chuxuka"/><p>外地</p>
            </div>
        </div>
        <div class="yzbox">
            <p>商业保险</p>
            <select class="yzselect" name="is_insurance">
                <option value="">请选择</option>
                @foreach($config['is_insurance'] as $key=>$val)
                <option value="{{$key}}">{{$val}}</option>
                @endforeach
            </select>
        </div>
        <div class="yzbox">
            <p>名下房产类型</p>
            <select class="yzselect" name="is_house">
                <option value="">请选择</option>
                @foreach($config['is_house'] as $key=>$val)
                    <option value="{{$key}}">{{$val}}</option>
                @endforeach
            </select>
        </div>
        <div class="yzbox">
            <p>名下是否有车</p>
            <select class="yzselect" name="is_car">
                <option value="">请选择</option>
                @foreach($config['is_car'] as $key=>$val)
                    <option value="{{$key}}">{{$val}}</option>
                @endforeach
            </select>
        </div>
        <button type="button" class="nextbtn subBtn" style="margin-top:30px;">下一步</button>
        </form>
    </div>




    <script>
        //同意
        $('.isagree').change(function(){
            if($('.isagree').is(':checked')==true){
                $('.subForm').attr('disabled',false)
            }else{
                $('.subForm').attr('disabled',true)
            }
        })
        $(document).ready(function () {
            var threeoptions = {
                success: function (data) {
                    $(".subBtn").attr('disabled',false);
                    layer.msg(data.message);
                    if(data.code=='0000'){
                        window.location.href="{{url('apply/fourstep')}}"+'?recordid='+"{{$recordid}}";
                    }
                }
            };
            $(".subBtn").click(function () {
                var fm=document.forms['threeForm'];// HTML DOM 通过form 元素的name值获取
                //
                if(fm.age.value==''){
                    layer.msg('请填写年龄');
                    return false;
                }
                if(fm.sex.value==''){
                    layer.msg('请选择性别');
                    return false;
                }
                if(fm.register.value==''){
                    layer.msg('请选择户籍');
                    return false;
                }
                if(fm.is_insurance.value==''){
                    layer.msg('请选择保险');
                    return false;
                }
                if(fm.is_house.value==''){
                    layer.msg('请选择房产类型');
                    return false;
                }
                if(fm.is_car.value==''){
                    layer.msg('请选择是否有车');
                    return false;
                }
                $(".subBtn").attr('disabled',true);//禁用按钮
                $("#threeForm").ajaxSubmit(threeoptions);
            });
        });

    </script>

@endsection